package com.webex.ta.hydra.core.engine;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-8-27
 * Time: 10:21:43
 */
public class HydraContextService {
//    private static ThreadLocal threadContext = new ThreadLocal() {
//        public Object initialValue() {
//            return new HydraContext();
//        }
//    };
//
//    public static HydraContext getContext() {
//        return (HydraContext) threadContext.get();
//    }
//
//    public static void reset() {
//        threadContext = new ThreadLocal() {
//            public Object initialValue() {
//                return new HydraContext();
//            }
//        };
//    }

    private static HydraContext threadContext;

    public static HydraContext getContext() {
        if (threadContext == null)
            threadContext = new HydraContext();
        return threadContext;
    }

    public static void reset() {
        threadContext = new HydraContext();
    }
}
